import 'package:mziot/app/data/device_group_entity.dart';
import 'package:mziot/generated/json/base/json_convert_content.dart';

DeviceGroupEntity $DeviceGroupEntityFromJson(Map<String, dynamic> json) {
  final DeviceGroupEntity deviceGroupEntity = DeviceGroupEntity();
  final List<DeviceGroupList>? list = jsonConvert.convertListNotNull<DeviceGroupList>(json['list']);
  if (list != null) {
    deviceGroupEntity.list = list;
  }
  final bool? hasNext = jsonConvert.convert<bool>(json['hasNext']);
  if (hasNext != null) {
    deviceGroupEntity.hasNext = hasNext;
  }
  return deviceGroupEntity;
}

Map<String, dynamic> $DeviceGroupEntityToJson(DeviceGroupEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['list'] = entity.list?.map((v) => v.toJson()).toList();
  data['hasNext'] = entity.hasNext;
  return data;
}

DeviceGroupList $DeviceGroupListFromJson(Map<String, dynamic> json) {
  final DeviceGroupList deviceGroupList = DeviceGroupList();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    deviceGroupList.id = id;
  }
  final String? groupName = jsonConvert.convert<String>(json['groupName']);
  if (groupName != null) {
    deviceGroupList.groupName = groupName;
  }
  final String? groupImg = jsonConvert.convert<String>(json['groupImg']);
  if (groupImg != null) {
    deviceGroupList.groupImg = groupImg;
  }
  final int? groupLightRate = jsonConvert.convert<int>(json['groupLightRate']);
  if (groupLightRate != null) {
    deviceGroupList.groupLightRate = groupLightRate;
  }
  final int? sceneLightRate = jsonConvert.convert<int>(json['sceneLightRate']);
  if (sceneLightRate != null) {
    deviceGroupList.sceneLightRate = sceneLightRate;
  }
  final bool? lockStatus = jsonConvert.convert<bool>(json['lockStatus']);
  if (lockStatus != null) {
    deviceGroupList.lockStatus = lockStatus;
  }
  final String? sceneName = jsonConvert.convert<String>(json['sceneName']);
  if (sceneName != null) {
    deviceGroupList.sceneName = sceneName;
  }
  final bool? isClose = jsonConvert.convert<bool>(json['isClose']);
  if (isClose != null) {
    deviceGroupList.isClose = isClose;
  }
  final int? deviceNum = jsonConvert.convert<int>(json['deviceNum']);
  if (deviceNum != null) {
    deviceGroupList.deviceNum = deviceNum;
  }
  return deviceGroupList;
}

Map<String, dynamic> $DeviceGroupListToJson(DeviceGroupList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['groupName'] = entity.groupName;
  data['groupImg'] = entity.groupImg;
  data['groupLightRate'] = entity.groupLightRate;
  data['sceneLightRate'] = entity.sceneLightRate;
  data['lockStatus'] = entity.lockStatus;
  data['sceneName'] = entity.sceneName;
  data['isClose'] = entity.isClose;
  data['deviceNum'] = entity.deviceNum;
  return data;
}
